package com.plan.service;

import com.plan.service.strategy.Factory;
import com.plan.service.strategy.Handler;
import com.plan.service.strategy01.AbstractHandler;
import com.plan.service.strategy01.FactoryAbstract;
import org.springframework.stereotype.Service;

/**
 * @description:
 * @author: admin
 * @time: 2022/12/8 22:35
 */
@Service
public class IfElseService {

    public void IfElseDemo(String name){
        Handler invokeStrategy = Factory.getInvokeStrategy(name);
        invokeStrategy.AAA(name);
    }

    public void IfElseDemo01(String name){
        AbstractHandler invokeStrategy = FactoryAbstract.getInvokeStrategy(name);
        String ccc = invokeStrategy.CCC();
        System.out.println(ccc);
    }
}
